Batch/Script rename all materials

Are there any resources or processes that would enable a rename (numerically) of all materials in a scene? Sometimes I want to rename a handful of materials but end up having to click into each one and rename them manually. I’ve tried to use chatgpt4 to create a script but I’m not getting anywhere. I’m definitely not a programmer so am not sure how to figure this out. Any help or tricks would be greatly appreciated.

Thank you.